<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;

class SwtTyGood extends Model
{
	use HasDateTimeFormatter;

    protected $table = 'swt_ty_goods';

    protected $guarded = [];

    public function tyGoodsImage()
    {
        return $this->hasMany(new SwtTyGoodsImage, 'ty_goods_id', 'id');
    }

    public function goods()
    {
        return $this->hasMany(SwtGood::class, 'bar_code', 'bar_code');
    }
}
